# for i in range(9):
#     for j in range(i+1):
#         print("{}*{}={}".format(i+1,j+1,(i+1)*(j+1)),end=' ')
#     print()


# for i in range(1,101):
#     if i % 3 == 0 and i % 5 == 0:
#         print(i,end=' ')

# for i in range (1,10):
#   for j in range (1,i+1):
#     print("{}*{}={}".format(i,j,i*j),end = ' ')
#   print()

# for i in range(1,101):
#   if (i % 3 == 0) and (i%5==0):
#     print(i,end = ' ')
#
# user_input = input().strip()
#
# # 检查输入是否有效
# if len(user_input) < 2:
#     print("输入有误")
# else:
#     # 提取温度符号和数值部分
#     symbol = user_input[-1].upper()
#     num_str = user_input[:-1]
#
#     # 尝试将数值部分转换为浮点数
#     try:
#         temperature = float(num_str)
#
#         # 根据符号进行转换
#         if symbol == 'C':
#             # 摄氏度转华氏度: F = C × 1.8 + 32
#             converted = temperature * 1.8 + 32
#             print(f"{converted:.2f}F")
#         elif symbol == 'F':
#             # 华氏度转摄氏度: C = (F - 32) / 1.8
#             converted = (temperature - 32) / 1.8
#             print(f"{converted:.2f}C")
#         else:
#             print("输入有误")
#     except ValueError:
#         print("输入有误")

# num = int(input("输入一个数"))
# for i in range(2, num + 1):
#     flag = 1  # 每次循环重置标志
#     for j in range(2, int(i**0.5) + 1):  # 优化循环范围
#         if i % j == 0:  # 修正判断条件
#             flag = 0
#             break
#     if flag == 1:
#         print(i, end=' ')

# num = int(input("输入一个数"))
# for i in range(2, num + 1):
#     flag = 1
#     for j in range(2, int(i ** 0.5) + 1):
#         if i % j == 0:
#             flag = 0
#             break
#     if flag == 1:
#         print(i, end=' ')


# n = int(input())
# t= 100
# sum = 100
# for i in range(n-1):
#     t = t / 2
#     sum = t * 2  + sum
# sum = float(sum)
# print("{0:.2f}".format(sum))

# user_input = input().strip()
#
# if len(user_input) < 2:
#     print("输入有误")
# else:
#     symbol = user_input[-1].upper()
#     num_str = user_input[:-1]
#
#     try:
#         t = float(num_str)
#         if symbol == 'C':
#             con = t * 1.8 + 32
#             print(f"{con:.2f}F")
#         elif symbol == 'F':
#             con = (t - 32) / 1.8
#             print(f"{con:.2f}C")
#         else:
#             print("输入有误")
#     except ValueError:
#         print("输入有误")

# user_input = input().strip()
#
# if(len(user_input) < 2):
#   print("输入有误")
# else:
#   symbol = user_input[-1].upper()
#   num_str = user_input[:-1]
# try:
#     t = float(num_str)
#     if symbol == 'C':
#   	    con = t * 1.8 + 32
#   	    print(f"{con:.2f}F")
#     elif symbol == 'F':
#   	    con = (t - 32) / 1.8
#  	    print(f"{con:.2f}C")
#     else:
# 	    print("输入有误")
# except ValueError:
#         print("输入有误")

# num = int(input("输入一个数"))
# for i in range(2,num+1):
#   flag = 1
#   for j in range(2,int(i**0.5)+1):
#     if i % j == 0:
#       flag = 0
#       break
#   if flag == 1:
#     print(i,end = ",")

# num = int(input("输入一个数"))
# # 先收集所有素数
# primes = []
# for i in range(2, num + 1):
#     flag = 1
#     for j in range(2, int(i**0.5) + 1):
#         if i % j == 0:
#             flag = 0
#             break
#     if flag == 1:
#         primes.append(str(i))  # 转为字符串方便后续拼接
#
# # 用逗号连接输出，避免末尾多余符号
# if primes:  # 确保列表不为空
#     print(", ".join(primes))

# num = int(input("输入一个数"))
# pr = []
# for i in range(2,num+1):
#   flag = 1
#   for j in range(2,int(i**0.5)+1):
#     if i % j == 0:
#       flag = 0
#       break
#   if flag == 1:
#     pr.append(str(i))
# if pr:
#   print(', '.join(pr))
#
# # 获取用户输入
# user_input = input().strip()
#
# # 检查输入是否包含温度符号
# if len(user_input) == 0 or user_input[-1] not in ['C', 'F']:
#     print("输入有误")
# else:
#     # 分离数值部分和单位
#     temp_str = user_input[:-1]
#     unit = user_input[-1]
#
#     try:
#         # 转换为数值
#         temperature = float(temp_str)
#
#         if unit == 'C':
#             # 摄氏度转华氏度: F = C × 1.8 + 32
#             converted = temperature * 1.8 + 32
#             print(f"{converted:.2f}F")
#         else:  # unit == 'F'
#             # 华氏度转摄氏度: C = (F - 32) ÷ 1.8
#             converted = (temperature - 32) / 1.8
#             print(f"{converted:.2f}C")
#
#     except ValueError:
#         # 处理数值部分无法转换为数字的情况
#         print("输入有误")

try:
    num = int(input("输入一个数"))
    primes = []

    if num >= 2:
        primes.append("2")

    for i in range(3, num + 1, 2):
        is_prime = True
        for j in range(3, int(i ** 0.5) + 1, 2):
            if i % j == 0:
                is_prime = False
                break
        if is_prime:
            primes.append(str(i))
    if primes:
        print(", ".join(primes))
except ValueError:
    print("请输入有效的整数")